import pygame, sys, math

class Button():
    def __init__(self, image, size = [100,100], pos = (0,0)):
        self.image = pygame.image.load(image)
        self.image = pygame.transform.scale(self.image, size)
        self.rect = self.image.get_rect()
        self.place(pos)
        
    def place(self, pos):
        self.rect.center = pos
        
    def collidePoint(self, pt):
        ptx = pt[0]
        pty = pt[1]
        
        if self.rect.left < ptx and self.rect.right > ptx:
            if self.rect.top < pty and self.rect.bottom > pty:
               return True
        return False
        